//
//  HMComposeButton.swift
//  WeiboTT
//
//  Created by 王嘉涛 on 2016/11/22.
//  Copyright © 2016年 王嘉涛. All rights reserved.
//

import UIKit
let composeBtnImageWidth: CGFloat = 80
let composeBtnHeight: CGFloat = 110

class HMComposeButton: UIButton {

    override init(frame: CGRect) {
        super.init(frame: frame)
        self.titleLabel?.textAlignment = .center
        self.titleLabel?.font = UIFont.systemFont(ofSize: 14)
        self.setTitleColor(UIColor.darkGray, for: .normal)
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    //返回titleLabel的frame
    override func titleRect(forContentRect contentRect: CGRect) -> CGRect {
        return CGRect(x: 0, y: composeBtnImageWidth, width: composeBtnImageWidth, height:composeBtnHeight - composeBtnImageWidth)
    }
    
    //返回imageView的frame
    override func imageRect(forContentRect contentRect: CGRect) -> CGRect {
        return CGRect(x: 0, y: 0, width: composeBtnImageWidth, height: composeBtnImageWidth)
    }


}
